home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 8
/
Amoszine 8 (Disk 2 of 3).adf
/
Powerbobs.lha
/
powerbobsv1.0
/
examples
/
pspritebob_col.asc
< prev
next >
Wrap
Text File
|
1992-09-02
|
833b
|
50 lines
'Collision detection between a Sprite and many Bob's.
Screen Open 0,320,200,4,L
Hide On
Cls 0
Box 0,0 To 15,15
Text 4,10,"1"
Get Bob 1,0,0 To 16,16
Cls 0
Box 0,0 To 15,15
Get Bob 2,0,0 To 16,16
Make Mask
Bob Update Off
Sprite Update Off
Reserve Pbobs 10
Pbob Dbuf False
For I=1 To 10
Pbob Height I,16
Next
Set Psprite Colours 4
Convert Sprites 1
Psprite 1,Rnd(100)+128,150+Rnd(20),1
Sprite 1,X Psprite(1),Y Psprite(1),1
For I=2 To 10
X=Rnd(100) : Y=Rnd(8)+120
Bob I,X,Y,2
Next
For I=2 To 10
Pbob I,X Bob(I),Y Bob(I),2
Next
Wait 10
Pbob Update
Wait Vbl
Psprite Update
T=Timer
For I=1 To 1000
A=Pspritebob Fastcol(1,2 To 10)
Next
Print Timer-T
Hide On
Bob Update
Sprite Update
T=Timer
For I=1 To 1000
A=Spritebob Col(1,2 To 10)
Next
Print Timer-T
For I=1 To 10
Print Pfast Sprbobcol(I),Col(I)
Next